7641e57612b65591c0fd00659042435e37a1a040,xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/store/XWikiHibernateStore.java,XWikiHibernateStore,saveXWikiDoc,#XWikiDocument#XWikiContext#boolean#,494

Before Change


            query.setLong("id", doc.getId());
            if (query.uniqueResult() == null) {
                // Reset the creationDate to reflect the date of the first save, not the date of the object creation
                doc.setCreationDate(new Date());
                session.save(doc);
            } else {
                session.update(doc);

After Change


            if (query.uniqueResult() == null) {
                if (doc.isContentDirty() || doc.isMetaDataDirty()) {
                    // Reset the creationDate to reflect the date of the first save, not the date of the object creation
                    doc.setCreationDate(new Date());
                }
                session.save(doc);
            } else {